<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>全部学生</title>
    <script src="/js/jquery-3.1.1.min.js"></script>
</head>
<body>
    <div>
        <table border="1">
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>班级</th>
                <th>操作</th>
            </tr>
            <tr th:each="student:${studentList}">
                <td th:text="${student.stuId}"></td>
                <td th:text="${student.stuName}"></td>
                <td th:text="${student.className}"></td>
                <td>
                    <a th:href="'/stu/deleteStu?stuId='+${student.stuId}">删除</a>
                    <a th:href="'/stu/toUpdate?stuId='+${student.stuId}">修改</a>
                </td>
            </tr>
        </table><br>
        <button id="button">添加新学生</button>
    </div>
</body>
</html>
<script>
    $("#button").click(function () {
        alert("点击了")
        window.location.href = "/stu/toAdd"
    })
</script>